Skip to content

Allow timezone override#525

Merged
marionbarker merged 3 commits intoloopandlearn:devfrom
ostap-korkuna:chart_tz_selector
Mar 2, 2026
Merged

Allow timezone override#525
marionbarker merged 3 commits intoloopandlearn:devfrom
ostap-korkuna:chart_tz_selector

Conversation

@ostap-korkuna
Copy link
Contributor

This change allows overriding the time zone used for the graph.

Backstory: When traveling for work and monitoring my son's numbers remotely, I get confused when the graph uses my time zone instead of his. I prefer to set it to his time zone, so it aligns with his sleep time, meal time, etc.

I added a setting under Graph Settings to override the graph time zone:

IMG_4594

For example, if I'm in London and my son is in San Francisco:

before
IMG_4593

after
IMG_4596

Note: When the time zone override is changed, markDirty() forces the time axis update. The pills on the graph points don't get updated immediately and require an app reload — this is consistent with how the graph behaves currently on the actual time zone changes, so I kept it that way.

@bjorkert bjorkert self-requested a review February 28, 2026 20:46
@marionbarker
Copy link
Collaborator

marionbarker commented Mar 2, 2026

Test

✅ Successful test.

Usage Explanation

NOTE - I edited this because a future PR will move the setting into General Settings to update the soon-to-be added Treatment tables and Statistics charts. I'll be grabbing these words as a first draft for the LoopFollowDocs updates.

In the LoopFollow Settings, chose General Settings and tap on Time Zone Override.

  • You set the time zone to that where the PWD lives and then the caregiver can travel without having the LF plot change to the caregivers current tz
    • It is easiest to do this the first time while in the same time zone; initially the current tz is the default
    • But any time zone can be manually selected, so if you forget, this can be done while on travel
  • The selection for the tz of the PWD user is remembered
  • Conversely, if the PWD is on travel, the tz can be adjusted to their current tz
  • If the PWD and caregiver happen to be traveling together, then the caregiver can just switch off the Time Zone Override for that joint trip

Configuration

Start with dev on the LoopFollow phone, iPhone 8 running iOS16

  • I am using this phone because I am not running any other tests on it
  • Changing automatic time will not cause an issue on this test phone
  • Please - any phone which is running an OS-AID (for real) should never modify time zone away from automatic

For later testing, update to code this PR for that same phone.

Common Timezone

Configure so LoopFollow phone follows a Loop URL with both phones in the same timezone.

  • Observe that LF plot aligns with Loop time zone
  • The Loop phone is in UTC -8

Timezone more negative wrt UTC

Modify the LF phone to be in a different timezone

  • change timezone to be UTC-10
    • observe LF plot time shifted as well
  • rebuild with code from this PR
    • must go into settings, graph settings, TimeZone Override and must select the desired timezone for the Loop (or Trio) phone
    • Selected US Pacific Time (UTC-8), LF phone is on Honolulu time (UTC-10
    • LF home plot shows the home time zone of UTC-8

Timezone more positive wrt UTC

Modify the LF phone to be in a different timezone

  • change timezone to be UTC+1 (Stockholm)
    • The Time Zone Offset remains configured for US Pacific Time (UTC-8)
    • LF home plot shows the home time zone of UTC-8
    • Disable Time Zone Offset, LF plot shows UTC+1 on the plot
    • Enable Time Zone Offset again - it remembers the previous setting for US Pacific Time
    • LF plot returns to UTC-8 plot

Repeat with a Trio URL

similar success

Copy link
Collaborator

@marionbarker marionbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review was already approved.

Test was successful.

LGTM

@marionbarker
Copy link
Collaborator

I pushed a linting change from when I built this branch.
The version with the linting change is the one that was tested.

@marionbarker marionbarker merged commit 8c7a068 into loopandlearn:dev Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants